home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / AppleGuide.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  9.4 KB  |  418 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleGuide.a
  3. ;
  4. ;    Contains:    Apple Guide Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__APPLEGUIDE__') = 'UNDEFINED' THEN
  21. __APPLEGUIDE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  25.     include 'AppleEvents.a'
  26.     ENDIF
  27. ;        include 'Errors.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'Types.a'                                            ;
  30. ;        include 'Memory.a'                                            ;
  31. ;            include 'MixedMode.a'                                    ;
  32. ;        include 'OSUtils.a'                                        ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'Quickdraw.a'                                    ;
  35. ;                include 'QuickdrawText.a'                            ;
  36. ;        include 'EPPC.a'                                            ;
  37. ;            include 'AppleTalk.a'                                    ;
  38. ;            include 'Files.a'                                        ;
  39. ;            include 'PPCToolbox.a'                                    ;
  40. ;            include 'Processes.a'                                    ;
  41. ;        include 'Notification.a'                                    ;
  42.  
  43.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  44.     include 'Files.a'
  45.     ENDIF
  46.  
  47.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  48.     include 'Types.a'
  49.     ENDIF
  50. ; typedef UInt32             AGRefNum
  51. ; typedef UInt32             AGCoachRefNum
  52. ; typedef UInt32             AGContextRefNum
  53. AGAppInfo                 RECORD    0
  54. eventId                     ds.l   1        ; offset: $0 (0)
  55. refCon                     ds.l   1        ; offset: $4 (4)
  56. contextObj                 ds.l   1        ; offset: $8 (8)        ; private system field
  57. sizeof                     EQU *            ; size:   $C (12)
  58.                         ENDR
  59.  
  60. ; typedef struct AGAppInfo     AGAppInfo, *AGAppInfoPtr, **AGAppInfoHdl
  61.  
  62. gestaltAppleGuidePresent        EQU        31
  63. gestaltAppleGuideIsDebug        EQU        30
  64. kAGDefault                        EQU        0
  65. kAGFrontDatabase                EQU        1
  66. kAGNoMixin                        EQU        (-1)
  67.  
  68. kAGViewFullHowdy                EQU        1                    ; Full-size Howdy
  69. kAGViewTopicAreas                EQU        2                    ; Full-size Topic Areas
  70. kAGViewIndex                    EQU        3                    ; Full-size Index Terms
  71. kAGViewLookFor                    EQU        4                    ; Full-size Look-For (Search)
  72. kAGViewSingleHowdy                EQU        5                    ; Single-list-size Howdy
  73. kAGViewSingleTopics                EQU        6                    ; Single-list-size Topics
  74.  
  75. kAGFileMain                        EQU        'poco'
  76. kAGFileMixin                    EQU        'mixn'
  77.  
  78. ; To test against AGGetAvailableDBTypes
  79. kAGDBTypeBitAny                    EQU        $00000001
  80. kAGDBTypeBitHelp                EQU        $00000002
  81. kAGDBTypeBitTutorial            EQU        $00000004
  82. kAGDBTypeBitShortcuts            EQU        $00000008
  83. kAGDBTypeBitAbout                EQU        $00000010
  84. kAGDBTypeBitOther                EQU        $00000080
  85.  
  86. ; typedef UInt16             AGStatus
  87. ; Returned by AGGetStatus
  88.  
  89. kAGIsNotRunning                    EQU        0
  90. kAGIsSleeping                    EQU        1
  91. kAGIsActive                        EQU        2
  92.  
  93. ; typedef UInt16             AGWindowKind
  94. ; Returned by AGGetFrontWindowKind
  95.  
  96. kAGNoWindow                        EQU        0
  97. kAGAccessWindow                    EQU        1
  98. kAGPresentationWindow            EQU        2
  99.  
  100. ; Error Codes
  101. ; Not an enum, because other OSErrs are valid.
  102. ; typedef SInt16             AGErr
  103. ; Apple Guide error codes
  104.  
  105. ; -------------------- Apple event reply codes
  106. kAGErrUnknownEvent                EQU        -2900
  107. kAGErrCantStartup                EQU        -2901
  108. kAGErrNoAccWin                    EQU        -2902
  109. kAGErrNoPreWin                    EQU        -2903
  110. kAGErrNoSequence                EQU        -2904
  111. kAGErrNotOopsSequence            EQU        -2905
  112. kAGErrReserved06                EQU        -2906
  113. kAGErrNoPanel                    EQU        -2907
  114. kAGErrContentNotFound            EQU        -2908
  115. kAGErrMissingString                EQU        -2909
  116. kAGErrInfoNotAvail                EQU        -2910
  117. kAGErrEventNotAvailable            EQU        -2911
  118. kAGErrCannotMakeCoach            EQU        -2912
  119. kAGErrSessionIDsNotMatch        EQU        -2913
  120. kAGErrMissingDatabaseSpec        EQU        -2914
  121. ; -------------------- Coach's Chalkboard reply codes
  122. kAGErrItemNotFound                EQU        -2925
  123. kAGErrBalloonResourceNotFound    EQU        -2926
  124. kAGErrChalkResourceNotFound        EQU        -2927
  125. kAGErrChdvResourceNotFound        EQU        -2928
  126. kAGErrAlreadyShowing            EQU        -2929
  127. kAGErrBalloonResourceSkip        EQU        -2930
  128. kAGErrItemNotVisible            EQU        -2931
  129. kAGErrReserved32                EQU        -2932
  130. kAGErrNotFrontProcess            EQU        -2933
  131. kAGErrMacroResourceNotFound        EQU        -2934
  132. ; -------------------- API reply codes
  133. kAGErrAppleGuideNotAvailable    EQU        -2951
  134. kAGErrCannotInitCoach            EQU        -2952
  135. kAGErrCannotInitContext            EQU        -2953
  136. kAGErrCannotOpenAliasFile        EQU        -2954
  137. kAGErrNoAliasResource            EQU        -2955
  138. kAGErrDatabaseNotAvailable        EQU        -2956
  139. kAGErrDatabaseNotOpen            EQU        -2957
  140. kAGErrMissingAppInfoHdl            EQU        -2958
  141. kAGErrMissingContextObject        EQU        -2959
  142. kAGErrInvalidRefNum                EQU        -2960
  143. kAGErrDatabaseOpen                EQU        -2961
  144. kAGErrInsufficientMemory        EQU        -2962
  145.  
  146. ; Events
  147. ; Not an enum because we want to make assignments.
  148. ; typedef UInt32             AGEvent
  149. ; Handy events for AGGeneral.
  150.  
  151. ; Panel actions (Require a presentation window).
  152. kAGEventDoCoach                    EQU        'doco'
  153. kAGEventDoHuh                    EQU        'dhuh'
  154. kAGEventGoNext                    EQU        'gonp'
  155. kAGEventGoPrev                    EQU        'gopp'
  156. kAGEventHidePanel                EQU        'pahi'
  157. kAGEventReturnBack                EQU        'gobk'
  158. kAGEventShowPanel                EQU        'pash'
  159. kAGEventTogglePanel                EQU        'patg'
  160.  
  161. ; Functions
  162. ; AGClose
  163. ; Close the database associated with the AGRefNum.
  164. ;
  165. ; pascal AGErr AGClose(AGRefNum *refNum)
  166. ;
  167.     IF ¬ GENERATINGCFM THEN
  168.         Macro
  169.         _AGClose
  170.             moveq    #17,d0
  171.             dc.w     $AA6E
  172.         EndM
  173.     ELSE
  174.         IMPORT_CFM_FUNCTION    AGClose
  175.     ENDIF
  176.  
  177. ; AGGeneral
  178. ; Cause various events to happen.
  179. ;
  180. ; pascal AGErr AGGeneral(AGRefNum refNum, AGEvent theEvent)
  181. ;
  182.     IF ¬ GENERATINGCFM THEN
  183.         Macro
  184.         _AGGeneral
  185.             moveq    #13,d0
  186.             dc.w     $AA6E
  187.         EndM
  188.     ELSE
  189.         IMPORT_CFM_FUNCTION    AGGeneral
  190.     ENDIF
  191.  
  192. ; AGGetAvailableDBTypes
  193. ; Return the database types available for this application.
  194. ;
  195. ; pascal UInt32 AGGetAvailableDBTypes(void)
  196. ;
  197.     IF ¬ GENERATINGCFM THEN
  198.         Macro
  199.         _AGGetAvailableDBTypes
  200.             moveq    #8,d0
  201.             dc.w     $AA6E
  202.         EndM
  203.     ELSE
  204.         IMPORT_CFM_FUNCTION    AGGetAvailableDBTypes
  205.     ENDIF
  206.  
  207. ; AGGetFrontWindowKind
  208. ; Return the kind of the front window.
  209. ;
  210. ; pascal AGWindowKind AGGetFrontWindowKind(AGRefNum refNum)
  211. ;
  212.     IF ¬ GENERATINGCFM THEN
  213.         Macro
  214.         _AGGetFrontWindowKind
  215.             moveq    #12,d0
  216.             dc.w     $AA6E
  217.         EndM
  218.     ELSE
  219.         IMPORT_CFM_FUNCTION    AGGetFrontWindowKind
  220.     ENDIF
  221.  
  222. ; AGGetFSSpec
  223. ; Return the FSSpec for the AGRefNum.
  224. ;
  225. ; pascal AGErr AGGetFSSpec(AGRefNum refNum, FSSpec *fileSpec)
  226. ;
  227.     IF ¬ GENERATINGCFM THEN
  228.         Macro
  229.         _AGGetFSSpec
  230.             moveq    #15,d0
  231.             dc.w     $AA6E
  232.         EndM
  233.     ELSE
  234.         IMPORT_CFM_FUNCTION    AGGetFSSpec
  235.     ENDIF
  236.  
  237. ; AGGetStatus
  238. ; Return the status of Apple Guide.
  239. ;
  240. ; pascal AGStatus AGGetStatus(void)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         Macro
  244.         _AGGetStatus
  245.             moveq    #9,d0
  246.             dc.w     $AA6E
  247.         EndM
  248.     ELSE
  249.         IMPORT_CFM_FUNCTION    AGGetStatus
  250.     ENDIF
  251.  
  252. ; AGInstallCoachHandler
  253. ; Install a Coach object location query handler.
  254. ;
  255. ; pascal AGErr AGInstallCoachHandler(CoachReplyUPP coachReplyProc, long refCon, AGCoachRefNum *resultRefNum)
  256. ;
  257.     IF ¬ GENERATINGCFM THEN
  258.         Macro
  259.         _AGInstallCoachHandler
  260.             moveq    #18,d0
  261.             dc.w     $AA6E
  262.         EndM
  263.     ELSE
  264.         IMPORT_CFM_FUNCTION    AGInstallCoachHandler
  265.     ENDIF
  266.  
  267. ; AGInstallContextHandler
  268. ; Install a context check query handler.
  269. ;
  270. ; pascal AGErr AGInstallContextHandler(ContextReplyUPP contextReplyProc, AEEventID eventID, long refCon, AGContextRefNum *resultRefNum)
  271. ;
  272.     IF ¬ GENERATINGCFM THEN
  273.         Macro
  274.         _AGInstallContextHandler
  275.             moveq    #19,d0
  276.             dc.w     $AA6E
  277.         EndM
  278.     ELSE
  279.         IMPORT_CFM_FUNCTION    AGInstallContextHandler
  280.     ENDIF
  281.  
  282. ; AGIsDatabaseOpen
  283. ; Return true if the database associated with the AGRefNum is open.
  284. ;
  285. ; pascal Boolean AGIsDatabaseOpen(AGRefNum refNum)
  286. ;
  287.     IF ¬ GENERATINGCFM THEN
  288.         Macro
  289.         _AGIsDatabaseOpen
  290.             moveq    #6,d0
  291.             dc.w     $AA6E
  292.         EndM
  293.     ELSE
  294.         IMPORT_CFM_FUNCTION    AGIsDatabaseOpen
  295.     ENDIF
  296.  
  297. ; AGOpen
  298. ; Open a guide database.
  299. ;
  300. ; pascal AGErr AGOpen(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, AGRefNum *resultRefNum)
  301. ;
  302.     IF ¬ GENERATINGCFM THEN
  303.         Macro
  304.         _AGOpen
  305.             moveq    #1,d0
  306.             dc.w     $AA6E
  307.         EndM
  308.     ELSE
  309.         IMPORT_CFM_FUNCTION    AGOpen
  310.     ENDIF
  311.  
  312. ; AGOpenWithSearch
  313. ; Open a guide database and preset a search string.
  314. ;
  315. ; pascal AGErr AGOpenWithSearch(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, ConstStr255Param searchString, AGRefNum *resultRefNum)
  316. ;
  317.     IF ¬ GENERATINGCFM THEN
  318.         Macro
  319.         _AGOpenWithSearch
  320.             moveq    #2,d0
  321.             dc.w     $AA6E
  322.         EndM
  323.     ELSE
  324.         IMPORT_CFM_FUNCTION    AGOpenWithSearch
  325.     ENDIF
  326.  
  327. ; AGOpenWithSequence
  328. ; Open a guide database and display a presentation window sequence.
  329. ;
  330. ; pascal AGErr AGOpenWithSequence(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, short sequenceID, AGRefNum *resultRefNum)
  331. ;
  332.     IF ¬ GENERATINGCFM THEN
  333.         Macro
  334.         _AGOpenWithSequence
  335.             moveq    #4,d0
  336.             dc.w     $AA6E
  337.         EndM
  338.     ELSE
  339.         IMPORT_CFM_FUNCTION    AGOpenWithSequence
  340.     ENDIF
  341.  
  342. ; AGOpenWithView
  343. ; Open a guide database and override the default view.
  344. ;
  345. ; pascal AGErr AGOpenWithView(FSSpec *fileSpec, UInt32 flags, Handle mixinControl, short viewNum, AGRefNum *resultRefNum)
  346. ;
  347.     IF ¬ GENERATINGCFM THEN
  348.         Macro
  349.         _AGOpenWithView
  350.             moveq    #5,d0
  351.             dc.w     $AA6E
  352.         EndM
  353.     ELSE
  354.         IMPORT_CFM_FUNCTION    AGOpenWithView
  355.     ENDIF
  356.  
  357. ; AGQuit
  358. ; Make Apple Guide quit.
  359. ;
  360. ; pascal AGErr AGQuit(void)
  361. ;
  362.     IF ¬ GENERATINGCFM THEN
  363.         Macro
  364.         _AGQuit
  365.             moveq    #16,d0
  366.             dc.w     $AA6E
  367.         EndM
  368.     ELSE
  369.         IMPORT_CFM_FUNCTION    AGQuit
  370.     ENDIF
  371.  
  372. ; AGRemoveCoachHandler
  373. ; Remove the Coach object location query handler.
  374. ;
  375. ; pascal AGErr AGRemoveCoachHandler(AGCoachRefNum *resultRefNum)
  376. ;
  377.     IF ¬ GENERATINGCFM THEN
  378.         Macro
  379.         _AGRemoveCoachHandler
  380.             moveq    #20,d0
  381.             dc.w     $AA6E
  382.         EndM
  383.     ELSE
  384.         IMPORT_CFM_FUNCTION    AGRemoveCoachHandler
  385.     ENDIF
  386.  
  387. ; AGRemoveContextHandler
  388. ; Remove the context check query handler.
  389. ;
  390. ; pascal AGErr AGRemoveContextHandler(AGContextRefNum *resultRefNum)
  391. ;
  392.     IF ¬ GENERATINGCFM THEN
  393.         Macro
  394.         _AGRemoveContextHandler
  395.             moveq    #21,d0
  396.             dc.w     $AA6E
  397.         EndM
  398.     ELSE
  399.         IMPORT_CFM_FUNCTION    AGRemoveContextHandler
  400.     ENDIF
  401.  
  402. ; AGStart
  403. ; Start up Apple Guide in the background.
  404. ;
  405. ; pascal AGErr AGStart(void)
  406. ;
  407.     IF ¬ GENERATINGCFM THEN
  408.         Macro
  409.         _AGStart
  410.             moveq    #10,d0
  411.             dc.w     $AA6E
  412.         EndM
  413.     ELSE
  414.         IMPORT_CFM_FUNCTION    AGStart
  415.     ENDIF
  416.  
  417.     ENDIF ; __APPLEGUIDE__
  418.